package com.ruoyi.syf.task;

import com.ruoyi.syf.common.constant.EscalationDataType;
import com.ruoyi.syf.handler.escalation.StrategyFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 上报定时任务
 */
@Slf4j
@Component
public class EscalationTask {

    @Autowired
    private StrategyFactory strategyFactory;

    /**
     * 每天23点45分执行
     */
//    @PostConstruct
    @Scheduled(cron = "0 45 23 * * ?")
    public void run(){
//        strategyFactory.escalation(EscalationDataType.UNIT.getCode());
//        strategyFactory.escalation(EscalationDataType.EVENTS.getCode());
//        strategyFactory.escalation(EscalationDataType.MEASURES.getCode());
//        strategyFactory.escalation(EscalationDataType.TASK.getCode());
        strategyFactory.escalation(EscalationDataType.RECORD.getCode());
//        strategyFactory.escalation(EscalationDataType.DANGER.getCode());
//        strategyFactory.escalation(EscalationDataType.UNIT_STOP.getCode());



//        strategyFactory.escalation(EscalationDataType.REAL_TIME.getCode());
//        strategyFactory.escalation(EscalationDataType.ALARM.getCode());
    }

}
